home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / snip9_91.arc / STRTRIM.C < prev    next >
C/C++ Source or Header  |  1991-09-17  |  267b  |  16 lines

  1. /*
  2. **  STRTRIM.C   - trims trailing spaces off of a string
  3. */
  4.  
  5. #include <string.h>
  6.  
  7. char *strtrim(char *str)
  8. {
  9.       register int i;
  10.  
  11.       for (i = strlen(str) - 1; str[i] == ' ' && i >= 0; i--)
  12.             ;
  13.       str[i+1]='\0';
  14.       return(str);
  15. }
  16.